{% extends 'base.html' %}

{% block title %}{{ title }}{% endblock %}

{% block content %}
  <!--Main layout-->
  <main class="mt-5 pt-5">
    <div class="container">
      <!--Section: Post-->
      <section class="mt-4">
        <!--Grid row-->
        <div class="row">
          <!--Grid column-->
          <div class="col-md-8 mb-4">
            <!--Featured Image-->
            <div class="card mb-4 wow fadeIn">
              <img src="{{ url_for('static', filename='img/'+this_cra.image) }}" class="img-fluid" alt="">
            </div>
            <!--/.Featured Image-->
            <!--Card-->
            <div class="card mb-4 wow fadeIn">
              <!--Card content-->
              <div class="card-body text-center">
                <p class="h5 my-4 font-weight-bold">{{ this_cra.title }}</p>
                {% for each in body %}
                <a href="{{ each[1] }}" target="_blank">
                    <h6 class="text-muted text-left" style="margin-left: 20px;">{{ each[0] }}</h6>
                </a>
                {% endfor %}
                <hr>

              {% if not current_user.is_athenticated or not current_user.is_subscribing(this_cra) %}
                <a class="btn btn-outline-primary" href="{{ url_for('auth.sub_add', crawler_id=crawler_id) }}"
                  role="button" target="_blank">订阅<i class="fas fa-download ml-2"></i></a>
              {% else %}
                <a class="btn btn-outline-primary active" role="button" target="_blank">已订阅<i class="fas fa-check ml-2"></i></a>
              {% endif %}
              </div>

            </div>
            <!--/.Card-->
          </div>
          <!--Grid column-->
          <!--Grid column-->
          <div class="col-md-4 mb-4">
            <!--Card: Jumbotron-->
            <div class="card blue-gradient wow fadeIn">
            </div>
            <!--Card: Jumbotron-->
            <!--Card-->
            <div class="card mb-4 wow fadeIn">
              <div class="card-header">猜你喜欢</div>
              <!--Card content-->
              <div class="card-body">
                <ul class="list-unstyled">
                  {% for guess in guesses %}
                    <li class="media">
                        <a class="media-body" href="{{ url_for('poly.detail',crawler_id=crawler_id) }}">{{ guess.name }}</a>
                    </li>
                  {% endfor %}
                </ul>
              </div>
            </div>
            <!--/.Card-->

          </div>
          <!--Grid column-->

        </div>
        <!--Grid row-->

      </section>
      <!--Section: Post-->

    </div>
  </main>
  <!--Main layout-->
{% endblock %}
